package com.itheima.huikebackend.controller;

import com.itheima.huikebackend.common.R;
import com.itheima.huikebackend.common.Result;
import com.itheima.huikebackend.service.SysDeptService;
import com.itheima.huikebackend.vo.DeptViewVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/system/dept")
@Slf4j
public class SysDeptController {

    @Autowired
    private SysDeptService sysDeptService;

    @GetMapping("/treeselect")
    public Result<List<DeptViewVO>> selectTree(){
        return Result.success(sysDeptService.selectTree());
    }
}
